import request from '@/utils/request'

/**
 * 获取月卡列表
 * @param { page, pageSize} params
 * @returns
 */
export function getCardListAPI(params) {
  return request({
    url: '/parking/card/list',
    params
  })
}

export function delCardAPI(id) {
  return request({
    url: `/parking/card/${id}`,
    method: 'DELETE'
  })
}

export const createCardAPI = (data) => request.post('/parking/card', data)
export const getCardDetailAPI = (id) => request.get(`/parking/card/detail/${id}`)
export const updateCardAPI = (data) => request.put('/parking/card/edit', data)

export function delAllCardAPI(ids) {
  return request({
    url: `/parking/card/${ids.join(',')}`,
    method: 'DELETE'
  })
}
